/// code : 1
/// message : "成功"
/// data : {"id":201,"mac":"BC:FF:4D:33:A5:DB","localName":null,"realTimeTemperature":27.9,"realTimeHumidity":54.9,"switchStatus":null,"createAt":1631859597000,"updateAt":1634797286000}
/// 主要为获取温湿度
class DeviceEnv {
  DeviceEnv({
    int? code,
    String? message,
    Data? data,
  }) {
    _code = code;
    _message = message;
    _data = data;
  }

  DeviceEnv.fromJson(dynamic json) {
    _code = json['code'];
    _message = json['message'];
    _data = json['data'] != null ? Data.fromJson(json['data']) : null;
  }

  int? _code;
  String? _message;
  Data? _data;

  int? get code => _code;

  String? get message => _message;

  Data? get data => _data;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['code'] = _code;
    map['message'] = _message;
    if (_data != null) {
      map['data'] = _data?.toJson();
    }
    return map;
  }
}

/// id : 201
/// mac : "BC:FF:4D:33:A5:DB"
/// localName : null
/// realTimeTemperature : 27.9
/// realTimeHumidity : 54.9
/// switchStatus : null
/// createAt : 1631859597000
/// updateAt : 1634797286000

class Data {
  Data({
    int? id,
    String? mac,
    dynamic localName,
    double? realTimeTemperature,
    double? realTimeHumidity,
    dynamic switchStatus,
    int? createAt,
    int? updateAt,
  }) {
    _id = id;
    _mac = mac;
    _localName = localName;
    _realTimeTemperature = realTimeTemperature;
    _realTimeHumidity = realTimeHumidity;
    _switchStatus = switchStatus;
    _createAt = createAt;
    _updateAt = updateAt;
  }

  Data.fromJson(dynamic json) {
    _id = json['id'];
    _mac = json['mac'];
    _localName = json['localName'];
    _realTimeTemperature = json['realTimeTemperature'];
    _realTimeHumidity = json['realTimeHumidity'];
    _switchStatus = json['switchStatus'];
    _createAt = json['createAt'];
    _updateAt = json['updateAt'];
  }

  int? _id;
  String? _mac;
  dynamic _localName;
  double? _realTimeTemperature;
  double? _realTimeHumidity;
  dynamic _switchStatus;
  int? _createAt;
  int? _updateAt;

  int? get id => _id;

  String? get mac => _mac;

  dynamic get localName => _localName;

  double? get realTimeTemperature => _realTimeTemperature;

  double? get realTimeHumidity => _realTimeHumidity;

  dynamic get switchStatus => _switchStatus;

  int? get createAt => _createAt;

  int? get updateAt => _updateAt;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['id'] = _id;
    map['mac'] = _mac;
    map['localName'] = _localName;
    map['realTimeTemperature'] = _realTimeTemperature;
    map['realTimeHumidity'] = _realTimeHumidity;
    map['switchStatus'] = _switchStatus;
    map['createAt'] = _createAt;
    map['updateAt'] = _updateAt;
    return map;
  }
}
